function randomnum(smin, smax) {// 获取2个值之间的随机数
    var Range = smax - smin;
    var Rand = Math.random();
    return (smin + Math.round(Rand * Range));
}

function runzp(a,b,c,d,e,index) {
    var data = '[{"id":1,"prize":"'+a+'","v":0.0},{"id":2,"prize":"'+b+'","v":0.0},{"id":3,"prize":"'+c+'","v":0.0},{"id":4,prize:"'+d+'","v":0.0},{"id":5,"prize":"'+e+'","v":0.0},{"id":6,"prize":"谢谢参与","v":0.0}]';// 奖项json
    var obj = eval('(' + data + ')');
    var result = randomnum(1, 0);
    var line = 0;
    var temp = 0;
    var returnobj = "0";
    returnobj = obj[index];
    for (var i = 0; i < obj.length; i++) {
        var obj2 = obj[i];
        if (obj2.v != 0) {
            index = i;
            returnobj = obj2;
            break;
        }
    }

    var angle = 0;
    var message = "";
    var myid=returnobj.id;

    var myreturn = new Object;

  //  if (returnobj.id != "1")
    {// 有奖
        if(returnobj.id != "6")
            message = "恭喜中奖了";
        else
            message = "很遗憾";
        var angle0 = [ 27, 87 ];
//        var angle0 = [ 344, 382.5 ];
//		var angle1 = [ 226, 256 ];
        var angle1 = [ 91, 149 ];
        var angle2 = [ 151, 209 ];
        var angle3 = [ 211, 269 ];
        var angle4 = [271, 329];
        var angle5 = [350, 387];
//        var angle6 = [180, 210];
//        var angle6 = [211, 239];
//        var angle7 = [241, 250];
//        var angle8 = [265, 270];
//        var angle9 = [291, 300];
//        var angle10 = [320, 340];
//        var angle11 = [355, 365];
        switch (index) {
            case 0:// 一等奖
                var r0 = randomnum(angle0[0], angle0[1]);
                angle = r0;
                break;
            case 1:// 二等奖
                var r1 = randomnum(angle1[0], angle1[1]);
                angle = r1;

                break;
            case 2:// 三等奖
                var r2 = randomnum(angle2[0], angle2[1]);
                angle = r2;
                break;
            case 3:// 三等奖
                var r2 = randomnum(angle3[0], angle3[1]);
                angle = r2;
                break;
            case 4:// 三等奖
                var r2 = randomnum(angle4[0], angle4[1]);
                angle = r2;

                break;
            case 5:// 三等奖
                var r2 = randomnum(angle5[0], angle5[1]);
                angle = r2;
                break;
            case 6:// 三等奖
                var r2 = randomnum(angle6[0], angle6[1]);
                angle = r2;
                break;
            case 7:// 三等奖
                var r2 = randomnum(angle7[0], angle7[1]);
                angle = r2;
                break;
            case 8:// 三等奖
                var r2 = randomnum(angle8[0], angle8[1]);
                angle = r2;
                break;
            case 9:// 三等奖
                var r2 = randomnum(angle9[0], angle9[1]);
                angle = r2;
                break;
            case 10:// 三等奖
                var r2 = randomnum(angle10[0], angle10[1]);
                angle = r2;
                break;
            case 11:// 三等奖
                var r2 = randomnum(angle11[0], angle11[1]);
                angle = r2;
                break;
        }
        myreturn.prize = returnobj.prize;
    }
//    else
//    {// 没有
//        message = "很遗憾";
//        var angle;
//        var angle6 = [180, 210];
//        var r3 = randomnum(angle6[0], angle6[1]);
//        angle = r3;
////        var angle3 = [ 17, 103 ];
////        var angle4 = [ 197, 220 ];
////        var angle5 = [ 259, 340 ];
////        var r = randomnum(3, 5);
////        var angle;
////        switch (r) {
////            case 3:
////                var r3 = randomnum(angle3[0], angle3[1]);
////                angle = r3;
////                break;
////            case 4:
////                var r4 = randomnum(angle4[0], angle4[1]);
////                angle = r4;
////                break;
////            case 5:
////                var r5 = randomnum(angle5[0], angle5[1]);
////                angle = r5;
////                break;
////        }
//        myreturn.prize = "谢谢参与!";
//
//    }
    myreturn.angle = angle;
   myreturn.id=myid;
    myreturn.message = message;
    return myreturn;
}// JavaScript Document